using System;
using System.Data;
using System.Collections.Generic;
using Soccer.Core;
using Soccer.Utility;

namespace Soccer.Business
{
    [TableAttribute("Matchs")]
	[Serializable]
    public class Match : DBO<Match>
    {
		#region Fields
		
		private int? _IdMatch;
		private int? _IdRound;
		private int? _IdClubHome;
		private int? _IdClubVisitor;
		private DateTime? _StartDate;
		private string _Status;
		private string _Result;
		private string _Description;
		private bool? _IsCare;
		
		#endregion
		
		#region Constructors
		/// <summary>
		/// Default constructor
		/// </summary>
		public Match()
		{
			
		}
		
		/// <summary>
		/// Constructor with IdMatch 
		/// </summary>
		/// <param name="IdMatch">The IdMatch</param>
		public Match(int? IdMatch )
		{
			this.IdMatch = IdMatch;
		}
		
		/// <summary>
		/// Constructor with all parameters
		/// </summary>
		/// <param name="IdMatch">Sets int? value for IdMatch</param>
		/// <param name="IdRound">Sets int? value for IdRound</param>
		/// <param name="IdClubHome">Sets int? value for IdClubHome</param>
		/// <param name="IdClubVisitor">Sets int? value for IdClubVisitor</param>
		/// <param name="StartDate">Sets DateTime? value for StartDate</param>
		/// <param name="Status">Sets string value for Status</param>
		/// <param name="Result">Sets string value for Result</param>
		/// <param name="Description">Sets string value for Description</param>
		/// <param name="IsCare">Sets bool? value for IsCare</param>
		public Match(int? idMatch, int? idRound, int? idClubHome, int? idClubVisitor, DateTime? startDate, string status, string result, string description, bool? isCare)
		{
			this.IdMatch = idMatch;
			this.IdRound = idRound;
			this.IdClubHome = idClubHome;
			this.IdClubVisitor = idClubVisitor;
			this.StartDate = startDate;
			this.Status = status;
			this.Result = result;
			this.Description = description;
			this.IsCare = isCare;
		}
		
		#endregion
		
		#region Properties
		
		/// <summary>
		/// Gets or sets int? value for IdMatch
		/// </summary>
		[ColumnAttribute("IdMatch", SqlDbType.Int , 4 , true, true, false)]
		public int? IdMatch
		{
			set
			{
				this._IdMatch = value;
			}
			get
			{
				return this._IdMatch;
			}
		}
		
		/// <summary>
		/// Gets or sets int? value for IdRound
		/// </summary>
		[ColumnAttribute("IdRound", SqlDbType.Int , 4 , false, false, true)]
		public int? IdRound
		{
			set
			{
				this._IdRound = value;
			}
			get
			{
				return this._IdRound;
			}
		}
		
		/// <summary>
		/// Gets or sets int? value for IdClubHome
		/// </summary>
		[ColumnAttribute("IdClubHome", SqlDbType.Int , 4 , false, false, true)]
		public int? IdClubHome
		{
			set
			{
				this._IdClubHome = value;
			}
			get
			{
				return this._IdClubHome;
			}
		}
		
		/// <summary>
		/// Gets or sets int? value for IdClubVisitor
		/// </summary>
		[ColumnAttribute("IdClubVisitor", SqlDbType.Int , 4 , false, false, true)]
		public int? IdClubVisitor
		{
			set
			{
				this._IdClubVisitor = value;
			}
			get
			{
				return this._IdClubVisitor;
			}
		}
		
		/// <summary>
		/// Gets or sets DateTime? value for StartDate
		/// </summary>
		[ColumnAttribute("StartDate", SqlDbType.DateTime , 8 , false, false, true)]
		public DateTime? StartDate
		{
			set
			{
				this._StartDate = value;
			}
			get
			{
				return this._StartDate;
			}
		}
		
		/// <summary>
		/// Gets or sets string value for Status
		/// </summary>
		[ColumnAttribute("Status", SqlDbType.NVarChar , 50 , false, false, true)]
		public string Status
		{
			set
			{
				this._Status = value;
			}
			get
			{
				return this._Status;
			}
		}
		
		/// <summary>
		/// Gets or sets string value for Result
		/// </summary>
		[ColumnAttribute("Result", SqlDbType.NVarChar , 10 , false, false, true)]
		public string Result
		{
			set
			{
				this._Result = value;
			}
			get
			{
				return this._Result;
			}
		}
		
		/// <summary>
		/// Gets or sets string value for Description
		/// </summary>
		[ColumnAttribute("Description", SqlDbType.NVarChar , 1000 , false, false, true)]
		public string Description
		{
			set
			{
				this._Description = value;
			}
			get
			{
				return this._Description;
			}
		}
		
		/// <summary>
		/// Gets or sets bool? value for IsCare
		/// </summary>
		[ColumnAttribute("IsCare", SqlDbType.Bit , 1 , false, false, true)]
		public bool? IsCare
		{
			set
			{
				this._IsCare = value;
			}
			get
			{
				return this._IsCare;
			}
		}
		
		
		/// <summary>
		/// Get a Club of current Match object base on IdClubHome
		/// </summary>
		public Club ClubHome
		{
			get
			{
				if (this.IdClubHome == null)
					return null;
	
				Club condition = new Club(this.IdClubHome);
				return ClubController.FindItem(condition);
			}
		}
		
		/// <summary>
		/// Get a Club of current Match object base on IdClubVisitor
		/// </summary>
		public Club ClubVisitor
		{
			get
			{
				if (this.IdClubVisitor == null)
					return null;
	
				Club condition = new Club(this.IdClubVisitor);
				return ClubController.FindItem(condition);
			}
		}
		
		/// <summary>
		/// Get a list AsianOdd of current Match object base on IdMatch
		/// </summary>
		public List<AsianOdd> AsianOddListForIdMatch
		{
			get
			{
				if (this.IdMatch == null)
					return null;
				AsianOdd condition = new AsianOdd();
				condition.IdMatch = this.IdMatch;
				return AsianOddController.FindItems(condition);
			}
		}
		
		/// <summary>
		/// Get a list AsianPredict of current Match object base on IdMatch
		/// </summary>
		public List<AsianPredict> AsianPredictListForIdMatch
		{
			get
			{
				if (this.IdMatch == null)
					return null;
				AsianPredict condition = new AsianPredict();
				condition.IdMatch = this.IdMatch;
				return AsianPredictController.FindItems(condition);
			}
		}
		
		/// <summary>
		/// Get a list Card of current Match object base on IdMatch
		/// </summary>
		public List<Card> CardListForIdMatch
		{
			get
			{
				if (this.IdMatch == null)
					return null;
				Card condition = new Card();
				condition.IdMatch = this.IdMatch;
				return CardController.FindItems(condition);
			}
		}
		
		/// <summary>
		/// Get a list EuroOdd of current Match object base on IdMatch
		/// </summary>
		public List<EuroOdd> EuroOddListForIdMatch
		{
			get
			{
				if (this.IdMatch == null)
					return null;
				EuroOdd condition = new EuroOdd();
				condition.IdMatch = this.IdMatch;
				return EuroOddController.FindItems(condition);
			}
		}
		
		/// <summary>
		/// Get a list EuroPredict of current Match object base on IdMatch
		/// </summary>
		public List<EuroPredict> EuroPredictListForIdMatch
		{
			get
			{
				if (this.IdMatch == null)
					return null;
				EuroPredict condition = new EuroPredict();
				condition.IdMatch = this.IdMatch;
				return EuroPredictController.FindItems(condition);
			}
		}
		
		/// <summary>
		/// Get a list Goal of current Match object base on IdMatch
		/// </summary>
		public List<Goal> GoalListForIdMatch
		{
			get
			{
				if (this.IdMatch == null)
					return null;
				Goal condition = new Goal();
				condition.IdMatch = this.IdMatch;
				return GoalController.FindItems(condition);
			}
		}
		
		/// <summary>
		/// Get a list UnderOverPredict of current Match object base on IdMatch
		/// </summary>
		public List<UnderOverPredict> UnderOverPredictListForIdMatch
		{
			get
			{
				if (this.IdMatch == null)
					return null;
				UnderOverPredict condition = new UnderOverPredict();
				condition.IdMatch = this.IdMatch;
				return UnderOverPredictController.FindItems(condition);
			}
		}
		
		/// <summary>
		/// Get a list Lineup of current Match object base on IdMatch
		/// </summary>
		public List<Lineup> LineupListForIdMatch
		{
			get
			{
				if (this.IdMatch == null)
					return null;
				Lineup condition = new Lineup();
				condition.IdMatch = this.IdMatch;
				return LineupController.FindItems(condition);
			}
		}
		
		/// <summary>
		/// Get a list MatchEvent of current Match object base on IdMatch
		/// </summary>
		public List<MatchEvent> MatchEventListForIdMatch
		{
			get
			{
				if (this.IdMatch == null)
					return null;
				MatchEvent condition = new MatchEvent();
				condition.IdMatch = this.IdMatch;
				return MatchEventController.FindItems(condition);
			}
		}
		
		/// <summary>
		/// Get a list MatchInfomation of current Match object base on IdMatch
		/// </summary>
		public List<MatchInfomation> MatchInfomationListForIdMatch
		{
			get
			{
				if (this.IdMatch == null)
					return null;
				MatchInfomation condition = new MatchInfomation();
				condition.IdMatch = this.IdMatch;
				return MatchInfomationController.FindItems(condition);
			}
		}
		
		/// <summary>
		/// Get a list ScoreOdd of current Match object base on IdMatch
		/// </summary>
		public List<ScoreOdd> ScoreOddListForIdMatch
		{
			get
			{
				if (this.IdMatch == null)
					return null;
				ScoreOdd condition = new ScoreOdd();
				condition.IdMatch = this.IdMatch;
				return ScoreOddController.FindItems(condition);
			}
		}
		
		/// <summary>
		/// Get a list ScorePredict of current Match object base on IdMatch
		/// </summary>
		public List<ScorePredict> ScorePredictListForIdMatch
		{
			get
			{
				if (this.IdMatch == null)
					return null;
				ScorePredict condition = new ScorePredict();
				condition.IdMatch = this.IdMatch;
				return ScorePredictController.FindItems(condition);
			}
		}
		
		/// <summary>
		/// Get a list UnderOverOdd of current Match object base on IdMatch
		/// </summary>
		public List<UnderOverOdd> UnderOverOddListForIdMatch
		{
			get
			{
				if (this.IdMatch == null)
					return null;
				UnderOverOdd condition = new UnderOverOdd();
				condition.IdMatch = this.IdMatch;
				return UnderOverOddController.FindItems(condition);
			}
		}
		
		/// <summary>
		/// Get a Round of current Match object base on IdRound
		/// </summary>
		public Round Round
		{
			get
			{
				if (this.IdRound == null)
					return null;
	
				Round condition = new Round(this.IdRound);
				return RoundController.FindItem(condition);
			}
		}
		
		#endregion
        
        #region Other Properties
        private static ColumnNameStruct? _ColumnName;
        public static ColumnNameStruct ColumnName
        {
            get
            {
                if (!_ColumnName.HasValue)
                    _ColumnName = new ColumnNameStruct();
                return _ColumnName.Value;
            }
        }
        #endregion

        #region NestedType
        public  struct ColumnNameStruct
        {
            /// <summary>
            /// Get the name of column [IdMatch]
            /// </summary>
            public string IdMatch
            {
                get
                {
                    return "IdMatch";
                }
            }
            /// <summary>
            /// Get the name of column [IdRound]
            /// </summary>
            public string IdRound
            {
                get
                {
                    return "IdRound";
                }
            }
            /// <summary>
            /// Get the name of column [IdClubHome]
            /// </summary>
            public string IdClubHome
            {
                get
                {
                    return "IdClubHome";
                }
            }
            /// <summary>
            /// Get the name of column [IdClubVisitor]
            /// </summary>
            public string IdClubVisitor
            {
                get
                {
                    return "IdClubVisitor";
                }
            }
            /// <summary>
            /// Get the name of column [StartDate]
            /// </summary>
            public string StartDate
            {
                get
                {
                    return "StartDate";
                }
            }
            /// <summary>
            /// Get the name of column [Status]
            /// </summary>
            public string Status
            {
                get
                {
                    return "Status";
                }
            }
            /// <summary>
            /// Get the name of column [Result]
            /// </summary>
            public string Result
            {
                get
                {
                    return "Result";
                }
            }
            /// <summary>
            /// Get the name of column [Description]
            /// </summary>
            public string Description
            {
                get
                {
                    return "Description";
                }
            }
            /// <summary>
            /// Get the name of column [IsCare]
            /// </summary>
            public string IsCare
            {
                get
                {
                    return "IsCare";
                }
            }
        }
        #endregion
    }
}
